package com.sc.citylist.controller;

import com.sc.citylist.entity.City;
import com.sc.citylist.service.CityDataService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * @author shuchang
 * @Date 2018/3/19 上午10:10
 */
@RestController
public class CityController {

    @Autowired
    private CityDataService cityDataService;

    @GetMapping("/cities")
    public List<City> list(){
        return cityDataService.listCity();
    }
}
